//前端页面
const home = [
  {
    path: '/',
    redirect: '/system/index'
  },
  {
    path: '/error',
    name: 'home_error',
    component: () => import('@/components/home/error/index.vue')
  },

  {
    path: '/index',
    component: () => import('@/layouts/home/common.vue'),
    children: [
      {
        path: '/index',
        name: 'index',
        meta: {
          title: '首页',
          auth: false
        },
        component: () => import('../components/home/index/index.vue')
      }
    ]
  },
  
  {
    path: '/index/api',
    name: 'api',
    component: () => import('@/components/home/api.vue')
  },
  {
    path: '/allView',
    name: 'allView',
    component: () => import('@/layouts/system/allView.vue')
  }
]

const system = [
  {
    path: '/system',
    name: 'system',
    meta: {
      title: '后台系统'
    },
    component: () => import('@/layouts/system/index.vue'),
    children: [
      {
        path: '/system',
        name: 'system_index',
        meta: {
          title: '首页',
          auth: false
        },
        component: () => import('@/components/system/index/index')
      },
      {
        path: '/system/index',
        name: 'system_index',
        meta: {
          title: '首页',
          auth: false
        },
        component: () => import('@/components/system/index/index')
      },
      {
        path: '/system/adver/slide/home',
        name: 'system_adver_slide_index',
        meta: {
          title: '首页幻灯片',
          auth: false
        },
        component: () => import('@/components/system/adver/info/home')
      },
      {
        path: '/system/user/index',
        name: 'system_user_index',
        meta: {
          title: '个人设置',
          auth: true
        },
        component: () => import('@/components/system/setting/user/index')
      },
      {
        path: '/system/role/index',
        name: 'system_role_index',
        meta: {
          title: '角色管理'
        },
        component: () => import('@/components/system/setting/role/index')
      },
      {
        path: '/system/role/permissions',
        name: 'system_role_permissions',
        meta: {
          title: '权限配置'
        },
        component: () => import('@/components/system/setting/role/permissions')
      },
      {
        path: '/system/role/seting',
        name: 'system_role_seting',
        meta: {
          title: '角色设置'
        },
        component: () => import('@/components/system/setting/role/seting')
      },

      {
        path: '/system/sms/index',
        name: 'system_sms_index',
        meta: {
          title: '短信接口'
        },
        component: () => import('@/components/system/setting/sms/index')
      },

      {
        path: '/system/admin/index',
        name: 'system_admin_index',
        meta: {
          title: '账号管理',
          auth: true
        },
        component: () => import('@/components/system/setting/admin/index')
      },
      {
        path: '/system/log/index',
        name: 'system_log_index',
        meta: {
          title: '日志管理',
          auth: true
        },
        component: () => import('@/components/system/setting/log/index')
      },
      {
        path: '/system/sys/index',
        name: 'system_sys_index',
        meta: {
          title: '网站基本管理',
          auth: true
        },
        component: () => import('@/components/system/setting/sys/index')
      },
      {
        path: '/system/menu/sys',
        name: 'system_menu_sys',
        meta: {
          title: '菜单管理',
          auth: true
        },
        component: () => import('@/components/system/setting/menu/sys')
      },

      {
        path: '/system/news/user',
        name: 'system_news_user',
        meta: {
          title: '用户协议',
          auth: true
        },
        component: () => import('@/components/system/news/info/user.vue')
      },

      {
        path: '/system/news/operation',
        name: 'system_news_operation',
        meta: {
          title: '隐私条款',
          auth: true
        },
        component: () => import('@/components/system/news/info/operation.vue')
      },

      {
        path: '/system/news/list',
        name: 'system_news_list',
        meta: {
          title: '新闻中心',
          auth: true
        },
        component: () => import('@/components/system/news/index.vue')
      },
      {
        path: '/system/news/add',
        name: 'system_news_add',
        meta: {
          title: '新闻编辑',
          auth: true
        },
        component: () => import('@/components/system/news/add.vue')
      },
      {
        path: '/system/bumen/index',
        name: 'system_bumen_index',
        meta: {
          title: '部门管理',
          auth: true
        },
        component: () => import('@/components/system/bumen/index.vue')
      },

      {
        path: '/system/member/index',
        name: 'system_member_index',
        meta: {
          title: '会员管理',
          auth: true
        },
        component: () => import('@/components/system/member/index.vue')
      },

      {
        path: '/system/merchants/index',
        name: 'system_merchants_index',
        meta: {
          title: '商户管理',
          auth: true
        },
        component: () => import('@/components/system/merchants/index.vue')
      },
      {
        path: '/system/merchants/user',
        name: 'system_merchants_user',
        meta: {
          title: '商户人员',
          auth: true
        },
        component: () => import('@/components/system/merchants/user.vue')
      },

      {
        path: '/system/merchants/shenhe',
        name: 'system_merchants_shenhe',
        meta: {
          title: '商户审核',
          auth: true
        },
        component: () => import('@/components/system/merchants/shenhe.vue')
      },
      {
        path: '/system/merchants/scsh',
        name: 'system_merchants_scsh',
        meta: {
          title: '删除申请',
          auth: true
        },
        component: () => import('@/components/system/merchants/scsh.vue')
      },
      {
        path: '/system/merchants/merchantslog',
        name: 'system_merchants_merchantslog',
        meta: {
          title: '删除申请',
          auth: true
        },
        component: () =>
          import('@/components/system/merchants/merchantslog.vue')
      },
      {
        path: '/system/merchants/merchantsclosed',
        name: 'system_merchants_merchantsclosed',
        meta: {
          title: '闭店记录',
          auth: true
        },
        component: () =>
          import('@/components/system/merchants/merchantsclosed.vue')
      },
      {
        path: '/system/merchants/delay',
        name: 'system_merchants_delay',
        meta: {
          title: '延期审核',
          auth: true
        },
        component: () => import('@/components/system/merchants/delay.vue')
      },
      {
        path: '/system/merchants/tsxx',
        name: 'system_merchants_tsxx',
        meta: {
          title: '推送消息',
          auth: true
        },
        component: () => import('@/components/system/merchants/tsxx.vue')
      },
      {
        path: '/system/merchants/shsltj',
        name: 'system_merchants_shsltj',
        meta: {
          title: '商户数量统计',
          auth: true
        },
        component: () => import('@/components/system/merchants/shsltj.vue')
      },

      {
        path: '/system/news/notice',
        name: 'system_news_notice',
        meta: {
          title: '公告管理',
          auth: true
        },
        component: () => import('@/components/system/news/notice.vue')
      },
      {
        path: '/system/news/notice_add',
        name: 'system_news_notice_add',
        meta: {
          title: '公告操作',
          auth: true
        },
        component: () => import('@/components/system/news/notice_add.vue')
      },
      {
        path: '/system/project/index',
        name: 'system_project_index',
        meta: {
          title: '商户提报',
          auth: true
        },
        component: () => import('@/components/system/project/index.vue')
      },

      {
        path: '/system/project/cq',
        name: 'system_project_cq',
        meta: {
          title: '超期商户',
          auth: true
        },
        component: () => import('@/components/system/project/cq.vue')
      },
      {
        path: '/system/project/lscq',
        name: 'system_project_lscq',
        meta: {
          title: '超期商户统计',
          auth: true
        },
        component: () => import('@/components/system/project/lscq.vue')
      }
    ]
  },

  {
    path: '/system/widget/images/index.html',
    name: `images`,
    meta: {
      auth: ['admin-user-user-index'],
      title: '上传图片'
    },
    component: () => import('@/components/system/uploadPictures/widgetImg')
  },
  {
    path: '/system/login',
    name: 'system_login',
    meta: {
      title: '总用户登录'
    },
    component: () => import('@/components/system/login/index')
  }
]
/**
 * 错误页面
 */

const errorPage = [
  {
    path: '/system/*',
    name: '404',
    meta: {
      title: '404'
    },
    component: () => import('@/components/system/error/404')
  }
]
export const systemInRoutes = system

// 重新组织后导出
export default [...home, ...system, ...errorPage]
